import Vue from 'vue'
import Router from 'vue-router'


export const constantRoutes = [
  {
    path: '/',
    component: () => import('@/views/index/index.vue'),
  },
]
const createRouter = () => new Router({
  mode: 'history', // history模式 require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()
// 重置路由
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}
Vue.use(Router)
export default router
